﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using LinQProject.Repository;
using LinQProject;

namespace LinQProject.Repository
{
    public class MyProcess<T> : DataBaseProcessBase<T>
           where T : class, new()
    {

        public MyProcess(FarmacieDataClassesDataContext database)
            : base(database)
        {
        }

        public object AddEntity(T ent)
        {
            return base.Add(ent, "ID");
        }

        public IList<T> GetEntity(DataLoadOptions options, Expression<Func<T, bool>> query, int beginPoint, int endPoint)
        {
            return base.Get(options, query, beginPoint, endPoint);
        }

        public IList<T> GetEntity(Expression<Func<T, bool>> query, int beginPoint, int endPoint)
        {
            return base.Get(query, beginPoint, endPoint);
        }

        public IList<T> GetEntity(int beginPoint, int endPoint)
        {
            return base.Get(beginPoint, endPoint);
        }

        public void UpdateEntity(T ent, Expression<Func<T, bool>> query)
        {
            base.Update(ent, query);
        }

        public void DeleteEntity(Expression<Func<T, bool>> query)
        {
            base.Delete(query);
        }
    }
}